<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/jquery-3.5.1.min.js"></script>
		<script>
			function funA(){
				var $list = $(":checked");
				for(var i=0;i<$list.length;i++){
					alert($list.eq(i).val());
				}
			}
			function funB(){
				var $list = $(":selected");
				alert($list.length);
			}
		</script>
	</head>
	<body>
		<button onclick="funA()">获取1</button>
		<button onclick="funB()">获取2</button>
		<input type="checkbox" value="aa"/>AA
		<input type="checkbox" value="bb"/>BB
		<input type="checkbox" value="cc"/>CC
		<input type="checkbox" value="dd"/>DD
		<hr/>
		<select>
			<option value="11">11</option>
			<option value="22">22</option>
			<option value="33">33</option>
			<option value="444">44</option>
		</select>
	</body>
</html>
